#!/bin/python3
import sys
import os
dirs = sys.argv[1:]
res = []
for d in dirs:
    if os.path.exists(os.path.join(d, "makefile")) or os.path.exists(os.path.join(d, "Makefile")):
        print(d, end=' ')
